<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta charset="utf-8">
<title>年终奖设置</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link id="bootstrap-style"
	href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet">
<link href="<c:url value="/css/bootstrap-responsive.min.css"/>"
	rel="stylesheet">
<link id="base-style" href="<c:url value="/css/style.css"/>"
	rel="stylesheet">
<link id="base-style-responsive"
	href="<c:url value="/css/style-responsive.css"/>" rel="stylesheet">
<link href="<c:url value="/css/index.css"/>" rel="stylesheet">
<link rel="shortcut icon" href="<c:url value="/img/favicon.ico"/>">
<link href="<c:url value="/css/page.css"/>" rel="stylesheet">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/css/jquery.datetimepicker.css"/>" />
<link href="<c:url value="/css/but.css"/>" rel="stylesheet">
<script src="<c:url value="/js/jquery-1.9.1.min.js"/>"></script>
<script src="<c:url value="/js/jquery-migrate-1.0.0.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/layer/layer.js"/>"></script>
<script src="<c:url value="/js/laydate/laydate.js"/>"></script>
<script src="<c:url value="/js/build/jquery.datetimepicker.full.js"/>"></script>
</head>
<script type="text/javascript">
	function closebutton() {
		var index = parent.layer.getFrameIndex(window.name);
		parent.layer.close(index);
	}

	function submitForm() {
		var isNum = /^(^[1-9](\d+)?(\.\d{1,2})?$)|(^(0){1}$)|(^\d\.\d{1,2}?$)/;
		var year=jQuery("#year").val().trim();
		var taxabletime=jQuery("#taxabletime").val().trim();
		var money=jQuery("#money").val().trim();
		if(year==null||year==""){
			alert("年份不能为空！");
			return;
		 }
		if(taxabletime==null||taxabletime==""){
			alert("应税时间不能为空！");
			return;
		 }
		if (money == "" || money == null) {
			alert("金额不能为空！");
			return;
		}
		if (!isNum.exec(money)) {
			alert("请输入正确的金额");
			return;
		}
		document.forms["frm"].submit();
	}
</script>
<body>

	<form name="frm" id="frm" method="post"
		action="<%=basePath%>salaryc/insertAnnualbonus" >
		<input type="hidden" id="userid" name="userid" value="${user.id }">
		<input type="hidden" id="pays" name="pays" value="">
		<div id="content" class="span10" style="width: 100%;">
			<div class="row-fluid content-table">
				<table id="tab"
					class="table table-striped table-bordered bootstrap-datatable">
					<tbody>
						<tr>
							<td style="text-align: right; vertical-align: middle;">
								姓名：
							</td>
							<td colspan="3" style="text-align: left; vertical-align: middle;">
								${user.name }
							</td>
						</tr>
						<tr id="trId">
							<td style="text-align: right; vertical-align: middle;">
								年份：
							</td>
							<td style="text-align: left; vertical-align: middle;">
								<input style="margin-bottom: 0px;" class="pay" type="text" id="year" name="year" value="${bonus.year }">
							</td>
						</tr>
						<tr id="trId">
							<td style="text-align: right; vertical-align: middle;">
								应税时间：
							</td>
							<td style="text-align: left; vertical-align: middle;">
								<input style="margin-bottom: 0px;" class="pay" type="text" id="taxabletime" name="taxabletime" value="${bonus.taxableTime }">
							</td>
						</tr>
						<tr id="trId">
							<td style="text-align: right; vertical-align: middle;">
								金额：
							</td>
							<td style="text-align: left; vertical-align: middle;">
								<input style="margin-bottom: 0px;" class="pay" type="text" id="money" name="money" value="${bonus.money }">
							</td>
						</tr>
						<tr class="content-search"
							style="text-align: center; vertical-align: middle;">
							<td colspan="5" style="width: 100%;">
								<div>
									<button style="background-color: #f55353;" type="button" onclick="closebutton();" id="output1">关闭</button>
									<button class="but" type="button" id="output" onclick="submitForm();">确定</button>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</form>
</body>
<script type="text/javascript">
	
	 $(function(){ 
		 var msg="${msg}";
		 if(msg!=null&&msg!=""){
			 alert(msg);
			 window.parent.location.reload(); //刷新父页面
			 var index = parent.layer.getFrameIndex(window.name);  
			 parent.layer.close(index);  
		 }
	 }); 
	
	
	//年选择器
	laydate.render({
	  elem: '#year'
	  ,type: 'year'
	});
	
	//年月选择器
	laydate.render({
	  elem: '#taxabletime'
	  ,type: 'month'
	});
	
</script>
</html>
